<?php

/**
 * 
 * Autor				: 	Juan Jose Muñiz Juarez
 * Fecha de Creacion	: 	22/04/2012,  00:10:43
 * Version 				: 	1.0
 * Descripcion 			:
 */

if ( !defined( "RUTA_FISICA_SISTEMA" ) )
{
   require_once "../../../../../config/Constantes.php";
}

$ruta_sistema = RUTA_FISICA_SISTEMA . "/sistema/";

require_once  $ruta_sistema . 'general/clases/js/jgrid/modelo/M_JGrid.php';

class JGrid
   {
      private $_m_jgrid;
      
      function __construct ( $m_jgrid)
         {
            if ( !$m_jgrid instanceof M_JGrid )
              {
                 throw new Exception( "Solo se puede recibir parametros del tipo M_JGrid" );
              }
              
           $this -> setM_jgrid( $m_jgrid );   
         }
	/**
     * @param field_type $_m_jgrid
     */
      public function setM_jgrid ( $_m_jgrid )
         {
            $this->_m_jgrid = $_m_jgrid;
         }
   
      public function generarCodigo()
        {
          // $this -> _m_jgrid = new M_JGrid();

           return json_encode( $this -> _m_jgrid -> getUrl() +
                       $this -> _m_jgrid -> getDatatype()  +
                       $this -> _m_jgrid -> getCol_names()  +           
                       $this -> _m_jgrid -> getCol_model()  +
                       $this -> _m_jgrid -> getRow_num() +
                       $this -> _m_jgrid -> getRow_list() +
                       $this -> _m_jgrid -> getPager() +
                       $this -> _m_jgrid -> getSort_name() +
                       $this -> _m_jgrid -> getSort_order() ); /*+
                       $this -> _m_jgrid -> getMultiselect()  +
                       $this -> _m_jgrid -> getEdit_url() +
                       $this -> _m_jgrid -> getCaption() +
                       $this -> _m_jgrid -> getExtra() +
                       $this -> _m_jgrid -> getGrid_complete() +
                       $this -> _m_jgrid -> getHeight() +   
                       $this -> _m_jgrid -> getWidth() );*/
           
           //return json_encode( $this -> _m_jgrid -> get );
        }   
   }
   
 $grid = new JGrid( new M_JGrid() );
 
 var_dump( $grid -> generarCodigo() );